Optimal. Leaf size=36 \[ \frac {3 b x}{8}-\frac {3}{8} b \cos (x) \sin (x)-\frac {1}{4} b \cos (x) \sin ^3(x)+\frac {1}{4} a \sin ^4(x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 5, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {3168, 2644, 30,
2715, 8} \begin {gather*} \frac {1}{4} a \sin ^4(x)+\frac {3 b x}{8}-\frac {1}{4} b \sin ^3(x) \cos (x)-\frac {3}{8} b \sin (x) \cos (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 30
Rule 2644
Rule 2715
Rule 3168
Rubi steps
\begin {align*} \int \sin ^3(x) (a \cos (x)+b \sin (x)) \, dx &=\int \left (a \cos (x) \sin ^3(x)+b \sin ^4(x)\right ) \, dx\\ &=a \int \cos (x) \sin ^3(x) \, dx+b \int \sin ^4(x) \, dx\\ &=-\frac {1}{4} b \cos (x) \sin ^3(x)+a \text {Subst}\left (\int x^3 \, dx,x,\sin (x)\right )+\frac {1}{4} (3 b) \int \sin ^2(x) \, dx\\ &=-\frac {3}{8} b \cos (x) \sin (x)-\frac {1}{4} b \cos (x) \sin ^3(x)+\frac {1}{4} a \sin ^4(x)+\frac {1}{8} (3 b) \int 1 \, dx\\ &=\frac {3 b x}{8}-\frac {3}{8} b \cos (x) \sin (x)-\frac {1}{4} b \cos (x) \sin ^3(x)+\frac {1}{4} a \sin ^4(x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.01, size = 34, normalized size = 0.94 \begin {gather*} \frac {3 b x}{8}+\frac {1}{4} a \sin ^4(x)-\frac {1}{4} b \sin (2 x)+\frac {1}{32} b \sin (4 x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.13, size = 28, normalized size = 0.78
method | result | size |
default | \(b \left (-\frac {\left (\sin ^{3}\left (x \right )+\frac {3 \sin \left (x \right )}{2}\right ) \cos \left (x \right )}{4}+\frac {3 x}{8}\right )+\frac {a \left (\sin ^{4}\left (x \right )\right )}{4}\) | \(28\) |
risch | \(\frac {3 b x}{8}+\frac {a \cos \left (4 x \right )}{32}+\frac {b \sin \left (4 x \right )}{32}-\frac {a \cos \left (2 x \right )}{8}-\frac {b \sin \left (2 x \right )}{4}\) | \(34\) |
norman | \(\frac {4 a \left (\tan ^{4}\left (\frac {x}{2}\right )\right )+\frac {3 b x}{8}-\frac {3 b \tan \left (\frac {x}{2}\right )}{4}-\frac {11 b \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{4}+\frac {11 b \left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{4}+\frac {3 b \left (\tan ^{7}\left (\frac {x}{2}\right )\right )}{4}+\frac {3 b x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2}+\frac {9 b x \left (\tan ^{4}\left (\frac {x}{2}\right )\right )}{4}+\frac {3 b x \left (\tan ^{6}\left (\frac {x}{2}\right )\right )}{2}+\frac {3 b x \left (\tan ^{8}\left (\frac {x}{2}\right )\right )}{8}}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )^{4}}\) | \(100\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 25, normalized size = 0.69 \begin {gather*} \frac {1}{4} \, a \sin \left (x\right )^{4} + \frac {1}{32} \, b {\left (12 \, x + \sin \left (4 \, x\right ) - 8 \, \sin \left (2 \, x\right )\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.60, size = 36, normalized size = 1.00 \begin {gather*} \frac {1}{4} \, a \cos \left (x\right )^{4} - \frac {1}{2} \, a \cos \left (x\right )^{2} + \frac {3}{8} \, b x + \frac {1}{8} \, {\left (2 \, b \cos \left (x\right )^{3} - 5 \, b \cos \left (x\right )\right )} \sin \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 75 vs.
\(2 (37) = 74\).
time = 0.14, size = 75, normalized size = 2.08 \begin {gather*} \frac {a \sin ^{4}{\left (x \right )}}{4} + \frac {3 b x \sin ^{4}{\left (x \right )}}{8} + \frac {3 b x \sin ^{2}{\left (x \right )} \cos ^{2}{\left (x \right )}}{4} + \frac {3 b x \cos ^{4}{\left (x \right )}}{8} - \frac {5 b \sin ^{3}{\left (x \right )} \cos {\left (x \right )}}{8} - \frac {3 b \sin {\left (x \right )} \cos ^{3}{\left (x \right )}}{8} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 33, normalized size = 0.92 \begin {gather*} \frac {3}{8} \, b x + \frac {1}{32} \, a \cos \left (4 \, x\right ) - \frac {1}{8} \, a \cos \left (2 \, x\right ) + \frac {1}{32} \, b \sin \left (4 \, x\right ) - \frac {1}{4} \, b \sin \left (2 \, x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.53, size = 35, normalized size = 0.97 \begin {gather*} \frac {a\,{\cos \left (x\right )}^4}{4}+\frac {b\,\sin \left (x\right )\,{\cos \left (x\right )}^3}{4}-\frac {a\,{\cos \left (x\right )}^2}{2}-\frac {5\,b\,\sin \left (x\right )\,\cos \left (x\right )}{8}+\frac {3\,b\,x}{8} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________